Integrand size = 23, antiderivative size = 90 \[ \int \frac {c+d \sin (e+f x)}{(3+b \sin (e+f x))^2} \, dx=\frac {2 (3 c-b d) \arctan \left (\frac {b+3 \tan \left (\frac {1}{2} (e+f x)\right )}{\sqrt {9-b^2}}\right )}{\left (9-b^2\right )^{3/2} f}+\frac {(b c-3 d) \cos (e+f x)}{\left (9-b^2\right ) f (3+b \sin (e+f x))} \]
[Out]
Time = 0.07 (sec) , antiderivative size = 97, normalized size of antiderivative = 1.08, number of steps used = 5, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.217, Rules used = {2833, 12, 2739, 632, 210} \[ \int \frac {c+d \sin (e+f x)}{(3+b \sin (e+f x))^2} \, dx=\frac {2 (a c-b d) \arctan \left (\frac {a \tan \left (\frac {1}{2} (e+f x)\right )+b}{\sqrt {a^2-b^2}}\right )}{f \left (a^2-b^2\right )^{3/2}}+\frac {(b c-a d) \cos (e+f x)}{f \left (a^2-b^2\right ) (a+b \sin (e+f x))} \]
[In]
[Out]
Rule 12
Rule 210
Rule 632
Rule 2739
Rule 2833
Rubi steps \begin{align*} \text {integral}& = \frac {(b c-a d) \cos (e+f x)}{\left (a^2-b^2\right ) f (a+b \sin (e+f x))}+\frac {\int \frac {-a c+b d}{a+b \sin (e+f x)} \, dx}{-a^2+b^2} \\ & = \frac {(b c-a d) \cos (e+f x)}{\left (a^2-b^2\right ) f (a+b \sin (e+f x))}+\frac {(a c-b d) \int \frac {1}{a+b \sin (e+f x)} \, dx}{a^2-b^2} \\ & = \frac {(b c-a d) \cos (e+f x)}{\left (a^2-b^2\right ) f (a+b \sin (e+f x))}+\frac {(2 (a c-b d)) \text {Subst}\left (\int \frac {1}{a+2 b x+a x^2} \, dx,x,\tan \left (\frac {1}{2} (e+f x)\right )\right )}{\left (a^2-b^2\right ) f} \\ & = \frac {(b c-a d) \cos (e+f x)}{\left (a^2-b^2\right ) f (a+b \sin (e+f x))}-\frac {(4 (a c-b d)) \text {Subst}\left (\int \frac {1}{-4 \left (a^2-b^2\right )-x^2} \, dx,x,2 b+2 a \tan \left (\frac {1}{2} (e+f x)\right )\right )}{\left (a^2-b^2\right ) f} \\ & = \frac {2 (a c-b d) \arctan \left (\frac {b+a \tan \left (\frac {1}{2} (e+f x)\right )}{\sqrt {a^2-b^2}}\right )}{\left (a^2-b^2\right )^{3/2} f}+\frac {(b c-a d) \cos (e+f x)}{\left (a^2-b^2\right ) f (a+b \sin (e+f x))} \\ \end{align*}
Time = 0.34 (sec) , antiderivative size = 89, normalized size of antiderivative = 0.99 \[ \int \frac {c+d \sin (e+f x)}{(3+b \sin (e+f x))^2} \, dx=\frac {-\frac {2 (-3 c+b d) \arctan \left (\frac {b+3 \tan \left (\frac {1}{2} (e+f x)\right )}{\sqrt {9-b^2}}\right )}{\left (9-b^2\right )^{3/2}}+\frac {(-b c+3 d) \cos (e+f x)}{(-3+b) (3+b) (3+b \sin (e+f x))}}{f} \]
[In]
[Out]
Time = 1.14 (sec) , antiderivative size = 144, normalized size of antiderivative = 1.60
method | result | size |
derivativedivides | \(\frac {\frac {-\frac {2 b \left (d a -c b \right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{\left (a^{2}-b^{2}\right ) a}-\frac {2 \left (d a -c b \right )}{a^{2}-b^{2}}}{\left (\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right ) a +2 b \tan \left (\frac {f x}{2}+\frac {e}{2}\right )+a}+\frac {2 \left (a c -b d \right ) \arctan \left (\frac {2 a \tan \left (\frac {f x}{2}+\frac {e}{2}\right )+2 b}{2 \sqrt {a^{2}-b^{2}}}\right )}{\left (a^{2}-b^{2}\right )^{\frac {3}{2}}}}{f}\) | \(144\) |
default | \(\frac {\frac {-\frac {2 b \left (d a -c b \right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{\left (a^{2}-b^{2}\right ) a}-\frac {2 \left (d a -c b \right )}{a^{2}-b^{2}}}{\left (\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right ) a +2 b \tan \left (\frac {f x}{2}+\frac {e}{2}\right )+a}+\frac {2 \left (a c -b d \right ) \arctan \left (\frac {2 a \tan \left (\frac {f x}{2}+\frac {e}{2}\right )+2 b}{2 \sqrt {a^{2}-b^{2}}}\right )}{\left (a^{2}-b^{2}\right )^{\frac {3}{2}}}}{f}\) | \(144\) |
risch | \(\frac {2 i \left (d a -c b \right ) \left (i b +a \,{\mathrm e}^{i \left (f x +e \right )}\right )}{b \left (a^{2}-b^{2}\right ) f \left (-i b \,{\mathrm e}^{2 i \left (f x +e \right )}+2 a \,{\mathrm e}^{i \left (f x +e \right )}+i b \right )}-\frac {\ln \left ({\mathrm e}^{i \left (f x +e \right )}+\frac {i a \sqrt {-a^{2}+b^{2}}-a^{2}+b^{2}}{b \sqrt {-a^{2}+b^{2}}}\right ) a c}{\sqrt {-a^{2}+b^{2}}\, \left (a +b \right ) \left (a -b \right ) f}+\frac {\ln \left ({\mathrm e}^{i \left (f x +e \right )}+\frac {i a \sqrt {-a^{2}+b^{2}}-a^{2}+b^{2}}{b \sqrt {-a^{2}+b^{2}}}\right ) b d}{\sqrt {-a^{2}+b^{2}}\, \left (a +b \right ) \left (a -b \right ) f}+\frac {\ln \left ({\mathrm e}^{i \left (f x +e \right )}+\frac {i a \sqrt {-a^{2}+b^{2}}+a^{2}-b^{2}}{b \sqrt {-a^{2}+b^{2}}}\right ) a c}{\sqrt {-a^{2}+b^{2}}\, \left (a +b \right ) \left (a -b \right ) f}-\frac {\ln \left ({\mathrm e}^{i \left (f x +e \right )}+\frac {i a \sqrt {-a^{2}+b^{2}}+a^{2}-b^{2}}{b \sqrt {-a^{2}+b^{2}}}\right ) b d}{\sqrt {-a^{2}+b^{2}}\, \left (a +b \right ) \left (a -b \right ) f}\) | \(396\) |
[In]
[Out]
none
Time = 0.32 (sec) , antiderivative size = 399, normalized size of antiderivative = 4.43 \[ \int \frac {c+d \sin (e+f x)}{(3+b \sin (e+f x))^2} \, dx=\left [-\frac {{\left (a^{2} c - a b d + {\left (a b c - b^{2} d\right )} \sin \left (f x + e\right )\right )} \sqrt {-a^{2} + b^{2}} \log \left (\frac {{\left (2 \, a^{2} - b^{2}\right )} \cos \left (f x + e\right )^{2} - 2 \, a b \sin \left (f x + e\right ) - a^{2} - b^{2} + 2 \, {\left (a \cos \left (f x + e\right ) \sin \left (f x + e\right ) + b \cos \left (f x + e\right )\right )} \sqrt {-a^{2} + b^{2}}}{b^{2} \cos \left (f x + e\right )^{2} - 2 \, a b \sin \left (f x + e\right ) - a^{2} - b^{2}}\right ) - 2 \, {\left ({\left (a^{2} b - b^{3}\right )} c - {\left (a^{3} - a b^{2}\right )} d\right )} \cos \left (f x + e\right )}{2 \, {\left ({\left (a^{4} b - 2 \, a^{2} b^{3} + b^{5}\right )} f \sin \left (f x + e\right ) + {\left (a^{5} - 2 \, a^{3} b^{2} + a b^{4}\right )} f\right )}}, -\frac {{\left (a^{2} c - a b d + {\left (a b c - b^{2} d\right )} \sin \left (f x + e\right )\right )} \sqrt {a^{2} - b^{2}} \arctan \left (-\frac {a \sin \left (f x + e\right ) + b}{\sqrt {a^{2} - b^{2}} \cos \left (f x + e\right )}\right ) - {\left ({\left (a^{2} b - b^{3}\right )} c - {\left (a^{3} - a b^{2}\right )} d\right )} \cos \left (f x + e\right )}{{\left (a^{4} b - 2 \, a^{2} b^{3} + b^{5}\right )} f \sin \left (f x + e\right ) + {\left (a^{5} - 2 \, a^{3} b^{2} + a b^{4}\right )} f}\right ] \]
[In]
[Out]
Timed out. \[ \int \frac {c+d \sin (e+f x)}{(3+b \sin (e+f x))^2} \, dx=\text {Timed out} \]
[In]
[Out]
Exception generated. \[ \int \frac {c+d \sin (e+f x)}{(3+b \sin (e+f x))^2} \, dx=\text {Exception raised: ValueError} \]
[In]
[Out]
none
Time = 0.28 (sec) , antiderivative size = 151, normalized size of antiderivative = 1.68 \[ \int \frac {c+d \sin (e+f x)}{(3+b \sin (e+f x))^2} \, dx=\frac {2 \, {\left (\frac {{\left (\pi \left \lfloor \frac {f x + e}{2 \, \pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (a\right ) + \arctan \left (\frac {a \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + b}{\sqrt {a^{2} - b^{2}}}\right )\right )} {\left (a c - b d\right )}}{{\left (a^{2} - b^{2}\right )}^{\frac {3}{2}}} + \frac {b^{2} c \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - a b d \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + a b c - a^{2} d}{{\left (a^{3} - a b^{2}\right )} {\left (a \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} + 2 \, b \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + a\right )}}\right )}}{f} \]
[In]
[Out]
Time = 8.38 (sec) , antiderivative size = 215, normalized size of antiderivative = 2.39 \[ \int \frac {c+d \sin (e+f x)}{(3+b \sin (e+f x))^2} \, dx=\frac {2\,\mathrm {atan}\left (\frac {\left (\frac {2\,\left (a^2\,b-b^3\right )\,\left (a\,c-b\,d\right )}{{\left (a+b\right )}^{3/2}\,\left (a^2-b^2\right )\,{\left (a-b\right )}^{3/2}}+\frac {2\,a\,\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\,\left (a\,c-b\,d\right )}{{\left (a+b\right )}^{3/2}\,{\left (a-b\right )}^{3/2}}\right )\,\left (a^2-b^2\right )}{2\,\left (a\,c-b\,d\right )}\right )\,\left (a\,c-b\,d\right )}{f\,{\left (a+b\right )}^{3/2}\,{\left (a-b\right )}^{3/2}}-\frac {\frac {2\,\left (a\,d-b\,c\right )}{a^2-b^2}+\frac {2\,b\,\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\,\left (a\,d-b\,c\right )}{a\,\left (a^2-b^2\right )}}{f\,\left (a\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2+2\,b\,\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )+a\right )} \]
[In]
[Out]